#include "PhysicActor.h"

PhysicActor::PhysicActor(void):
Actor()
{
}

PhysicActor::PhysicActor(Sprite *& sprite, PhysicObject *& physicObject):
Actor(sprite, (GameObject *&)physicObject),
pObject( &(physicObject) )
{
}

PhysicActor::~PhysicActor(void)
{
	delete *spr; //?
	*spr = NULL;
}

void PhysicActor::update()
{
	(*spr)->x =  (*pObject)->body->GetPosition().x * Config::PHYSIC_SCALE - (*pObject)->width / 2; //floor;
	(*spr)->y = (*pObject)->body->GetPosition().y * Config::PHYSIC_SCALE - (*pObject)->height / 2;
	//(*spr)->width = (*gObject)->width;
	//(*spr)->height = (*gObject)->height;
	(*spr)->visible = (*pObject)->visible;
	(*spr)->setRotation( (*pObject)->body->GetAngle() );
}
